package com.spring.web.adminmanage.controller;

import com.spring.web.adminmanage.common.PageResult;
import com.spring.web.adminmanage.entities.UserLoginLog;
import com.spring.web.adminmanage.service.UserLoginLogService;
import com.spring.web.adminmanage.utils.MenuUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by hetao on 2017/9/18
 */
@Controller
@RequestMapping("/backstageloginlog")
public class UserLoginLogController {
    @Autowired
    UserLoginLogService userLoginLogService;

    @RequestMapping("/list")
    public String list(HttpServletRequest request) {
        MenuUtil.fmtMenu(request,"/backstageloginlog/list");
        return "backstageloginlog/backstageloginlog_list";
    }

    @ResponseBody
    @RequestMapping("/data")
    public PageResult<UserLoginLog> data(HttpServletRequest request, Integer pageSize, Integer pageNumber, String username,
                                         String ip, String queryTimeRange) {
        return userLoginLogService.selectToPageResult(pageSize, pageNumber, username, ip, queryTimeRange);
    }
}